import { contextBridge } from 'electron';
import { electronAPI } from '@electron-toolkit/preload';
import api from './utils/api';
import http from './utils/http';



if (process.contextIsolated) {
  try {
    contextBridge.exposeInMainWorld('electron', electronAPI);
    contextBridge.exposeInMainWorld('api', api);
    contextBridge.exposeInMainWorld('http', http);
  } catch (error) {
    console.error(error)
  }
} else {
  // @ts-ignore (define in dts)
  window.electron = electronAPI
  // @ts-ignore (define in dts)
  window.api = api;
  // @ts-ignore (define in dts)
  window.http = http;
}
